<?php
namespace Frontend\Modules\Video\Controllers;
use Phalcon\Mvc\User\Component;
use Common\Models\Videos\VideoCategory;
use Common\Models\Videos\National;
use Common\Models\Videos\Artist;
use Common\Library\Common as LibraryCommon;
class CategoryController extends \FrontendController
{

    public function indexAction()
    {
        try {

            $this->assets
            ->addCss('vendor/frontend/css/video/category/category.css')
            ->addCss('vendor/frontend/css/home/home.css')
            ->addJs('vendor/frontend/js/video/category/category_angular.js');

            $countries = $this->getCountries();
            $artists = $this->getArtists();
            $years = LibraryCommon::listYear();

            $this->view->setVars(array(
                'countries' => $countries,
                'artists'   => $artists,
                'years'     => $years
            ));

            
        } catch (\Exception $e) {
        	$this->flash->error($e->getMessage());
        }
    }
    public function getCountries(){
        return National::find();
    }
    public function getArtists(){
        return Artist::find();
    }
}

